﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.Search" Title="" StylesheetTheme="SkinFile"
    Theme="SkinFile" Codebehind="Search.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="Search" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Panel runat="server" DefaultButton="SearchButton">
        <div class="basic_element">
        <div class="red_title">
           <asp:Label ID="PageNameLabel2" runat="server" Text="Search" CssClass="white_title"></asp:Label>
        </div>
        <div class="padding5 align_center">

        <asp:Label ID="MessageLabel" runat="server" SkinID="GreenSmallHeaderLabel"></asp:Label>
        <br />
        <asp:Label ID="LookForLabel" runat="server" Text="<%$ Resources:Resource, Global_LookFor %>"
         SkinID="InfoLabel"></asp:Label>
        <asp:DropDownList ID="SearchTypeDDL" runat="server" CssClass="rounded_corners">
            <%--<asp:ListItem Text="<%$ Resources:Resource, Search_AllText %>" Value="0" Selected="True"></asp:ListItem>--%>
            <asp:ListItem Text="<%$ Resources:Resource, Global_Players %>" Value="1"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Search_TeamsText %>" Value="2"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Search_UsersText %>" Value="3"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Global_Matches %>" Value="4"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Search_CoachesText %>" Value="5"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Global_Leagues %>" Value="6"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Search_StadiumsText %>" Value="7"></asp:ListItem>
            <asp:ListItem Text="<%$ Resources:Resource, Global_Countries %>" Value="8"></asp:ListItem>
        </asp:DropDownList>
        <br /><br />
        <asp:RegularExpressionValidator ID="TextBoxLengthValidator" ValidationGroup="Search" runat="server"  
            ControlToValidate="SearchTextBox" SetFocusOnError="true" ValidationExpression="[^\s].{1,254}[^\s]">
            <asp:Label ID="ValidationLabel" runat="server" Text='<%$ Resources:Resource, Search_StringTooShort %>' SkinID="RedSmallHeaderLabel"></asp:Label>
        </asp:RegularExpressionValidator>
        <asp:TextBox ID="SearchTextBox" runat="server" MaxLength="256" Width="80%" CssClass="rounded_corners"  ></asp:TextBox>
        <br /><br />
        <asp:Button ID="SearchButton" runat="server" CssClass="GreenSmallButtonStyle" ValidationGroup="Search"
         CausesValidation="true" Text="<%$ Resources:Resource, Global_Search %>" OnClick="SearchButtonClick" />
        <br /><br />
        <asp:UpdatePanel ID="ResultsPanel" runat="server" Visible="false" UpdateMode="Conditional">
            <ContentTemplate>
                
                <asp:UpdateProgress ID="MessagesUpdatePanelProgress" runat="server" AssociatedUpdatePanelID="ResultsPanel">
                    <ProgressTemplate>
                        <div class="ajaxloader">
                            <asp:Image ID="MessagesUpdatePanelProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>                    
                
                <asp:GridView ID="SearchResultsGridView" runat="server" DataSourceId="SearchSqlDataSource" AutoGenerateColumns="false"
                 AllowPaging="false" SkinID="Professional">
                    <EmptyDataTemplate>
                        <asp:Label ID="NothingFoundlabel" runat="server" Text="<%$ Resources:Resource, Search_NothingFound %>" SkinID="GridLabel"></asp:Label>
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="20%">
                            <ItemTemplate>  
                                <asp:Label ID="PlayerLabel" runat="server" Text="<%$ Resources:Resource, Global_Player %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "1" %>'></asp:Label>
                                <asp:Label ID="TeamLabel" runat="server" Text="<%$ Resources:Resource, Global_Team %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "2" %>'></asp:Label>
                                <asp:Label ID="UserLabel" runat="server" Text="<%$ Resources:Resource, Search_UserText %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "3" %>'></asp:Label>
                                <asp:Label ID="MatchLabel" runat="server" Text="<%$ Resources:Resource, Global_Match %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "4" %>'></asp:Label>
                                <asp:Label ID="CoachLabel" runat="server" Text="<%$ Resources:Resource, Global_Coach %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "5" %>'></asp:Label>
                                <asp:Label ID="LeagueLabel" runat="server" Text="<%$ Resources:Resource, Global_League %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "6" %>'></asp:Label>
                                <asp:Label ID="StadiumLabel" runat="server" Text="<%$ Resources:Resource, Global_Stadium %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "7" %>'></asp:Label>
                                <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, Global_Country %>"
                                 SkinID="GridLabel" Visible='<%# Eval("ResultType").ToString() == "8" %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="PlayerHyperlink" runat="server" NavigateUrl='<%# "~/Player.aspx?Id=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "1" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="TeamHyperlink" runat="server" NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "2" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="UserHyperlink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("ResultGuid") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "3" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="MatchHyperlink" runat="server" NavigateUrl='<%# "~/MatchPage.aspx?MatchId=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "4" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="CoachHyperlink" runat="server" NavigateUrl='<%# "~/Coach.aspx?Id=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "5" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="LeagueHyperlink" runat="server" NavigateUrl='<%# "~/league.aspx?LeagueId=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "6" %>' SkinID="BlackHyperLinkSkin" ></asp:HyperLink>
                                
                                <asp:HyperLink ID="StadiumHyperlink" runat="server" NavigateUrl='<%# "~/StadiumPage.aspx?StadiumId=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "7" %>'  SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                                 
                                <asp:HyperLink ID="CountryHyperlink" runat="server" NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("ResultId") %>'
                                 Text='<%# Eval("ResultText") %>' Visible='<%# Eval("ResultType").ToString() == "8" %>'  SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            
                <asp:SqlDataSource ID="SearchSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_GlobalSearch" SelectCommandType="StoredProcedure"></asp:SqlDataSource>    
            
            </ContentTemplate>
        </asp:UpdatePanel>
        </div>
        </div>
    </asp:Panel>
        






<%--    <asp:Label ID="ErrorLabel" runat="server" Text="" SkinID="ErrorLabel"></asp:Label>
    <br />
    <asp:Button ID="btnPlayer" CommandName="Player" OnCommand="button_click" Text="Player"
        runat="server" CssClass="GreyButtonTextStyle" />
    <asp:Button ID="btnTeam" CommandName="Team" OnCommand="button_click" Text="Team"
        runat="server" CssClass="GreyButtonTextStyle" />
    <asp:Button ID="btnLeague" CommandName="League" OnCommand="button_click" Text="League"
        runat="server" CssClass="GreyButtonTextStyle" />
    <br />
    <asp:Button ID="btnCoach" CommandName="Coach" OnCommand="button_click" Text="Coach"
        runat="server" CssClass="GreyButtonTextStyle" />
    <asp:Button ID="btnUser" CommandName="User" OnCommand="button_click" Text="User"
        runat="server" CssClass="GreyButtonTextStyle"/>
    <asp:Button ID="btnMatch" CommandName="Match" OnCommand="button_click" Text="Match"
        runat="server" CssClass="GreyButtonTextStyle"/>
    <br />
    <br />
    <asp:Label ID="TitleLabel" runat="server" SkinID="TeamNameLabel"></asp:Label>

    <asp:Panel ID="pnlPlayer" runat="server" Height="382px" Width="278px">
        <table style="width: 100%;">
            <tr>
                <td>
                    <asp:Label ID="PlayerFirstNameTitleLabel" runat="server" Text="First Name:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="FirstNameTextBox" runat="server" MaxLength="128" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="PlayerLastNameTitleLabel" runat="server" Text="Last Name:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="LastNameTextBox" runat="server" MaxLength="128" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button1" runat="server" ValidationGroup="NameSearch" Text="Search"
                        OnClick="PlayerName_Click" CssClass="GreenButtonTextStyle"  />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" ControlToValidate="FirstNameTextBox"
                        ErrorMessage="Illigal first name" ValidationExpression="^[0-9a-zA-Z]{2,128}$"
                        ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator2" ControlToValidate="LastNameTextBox"
                        ErrorMessage="Illigal last name" ValidationExpression="^[0-9a-zA-Z]{2,128}$" ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="PlayerIdTitleLabel" runat="server" Text="PlayerId:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="PlayerIdTextBox" runat="server" MaxLength="12" ValidationGroup="IdSearch"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button2" runat="server" ValidationGroup="IdSearch" Text="Search"
                        OnClick="PlayerId_Click" CssClass="GreenButtonTextStyle" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator3" ControlToValidate="PlayerIdTextBox"
                        ErrorMessage="Illigal Player Id" ValidationExpression="^[0-9]{2,12}$" ValidationGroup="IdSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchPlayerByNameGridView" runat="server" DataSourceID="SearchPlayerByNameSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Players"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "Player.aspx?Id={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoPlayersFoundByName" runat="server" Text="No players found" SkinID="InfoLabel"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchPlayerByNameSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchPlayerByName" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:GridView ID="SearchPlayerByIdGridView" runat="server" DataSourceID="SearchPlayerByIdSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True"
            Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Players"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "Player.aspx?Id={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoPlayersFoundById" runat="server" Text="No players found" SkinID="InfoLabel"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchPlayerByIdSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchPlayerById" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlLeague" runat="server" Height="382px" Width="278px">
        <table style="width: 300px;">
            <tr>
                <td>
                    <asp:DropDownList ID="ListOfCountriesDropDownList" EnableViewState="true" AutoPostBack="true"
                        DataSourceID="ListOfCountriesSqlDataSource" DataTextField="Name" DataValueField="Id"
                        runat="server" OnSelectedIndexChanged="ListOfCountriesDropDownList_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td valign="bottom">
                    <asp:DropDownList ID="ListOfLeaguesDropDownList" EnableViewState="true" AutoPostBack="true"
                        DataSourceID="ListOfLeaguesSqlDataSource" DataTextField="Level" DataValueField="LevelId"
                        Visible="false" runat="server" OnSelectedIndexChanged="ListOfLeaguesDropDownList_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:DropDownList ID="LeagueNumbersDropDownList" EnableViewState="true" AutoPostBack="true"
                        DataSourceID="LeagueNumbersSqlDataSource" DataTextField="Number" DataValueField="NumberId"
                        Visible="false" runat="server" OnSelectedIndexChanged="LeagueNumbersDropDownList_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="SearchLeagueTitleLabel" runat="server" Text="Search League by Id:" SkinID="InfoLabel"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="NameLeagueTextBox" runat="server" MaxLength="12" ValidationGroup="LeagueSearch"
                        Width="80px"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button5" runat="server" ValidationGroup="LeagueSearch" Text="Search"
                        OnClick="League_Click" CssClass="GreenButtonTextStyle" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td valign="bottom">
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator6" ControlToValidate="NameLeagueTextBox"
                        ErrorMessage="Illigal League Id" ValidationExpression="^[0-9]{4,12}$" ValidationGroup="LeagueSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchLeagueGridView" runat="server" DataSourceID="SearchLeagueSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Leagues"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("LeagueName") %>' NavigateUrl='<%# Eval("LeagueId", "league.aspx?LeagueId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No League match this search
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchLeagueSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchLeagueByNumber" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:GridView ID="SearchLeagueByIdGridView" runat="server" DataSourceID="SearchLeagueByIdSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Leagues"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("LeagueName") %>' NavigateUrl='<%# Eval("LeagueId", "league.aspx?LeagueId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No League match this search
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchLeagueByIdSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchLeagueById" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="ListOfCountriesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetListOfCountries " SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="ListOfLeaguesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetListOfLeagueLevels" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="LeagueNumbersSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetListOfLeagueNumbers" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlTeam" runat="server" Height="382px" Width="278px">
        <table style="width: 300px;">
            <tr>
                <td>
                    <asp:Label ID="TeamNameTitleLabel" runat="server" Text="Team Name:" SkinID="InfoLabel"></asp:Label>  
                </td>
                <td>
                    <asp:TextBox ID="TeamNameTextBox" runat="server" MaxLength="256" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button3" runat="server" ValidationGroup="NameSearch" Text="Search"
                        OnClick="TeamName_Click" CssClass="GreenButtonTextStyle"/>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator4" ControlToValidate="TeamNameTextBox"
                        ErrorMessage="Illigal Team Name" ValidationExpression="^[0-9a-zA-Z]{2,256}$"
                        ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="TeamIdTitleLabel" runat="server" Text="TeamId:" SkinID="InfoLabel"></asp:Label>
                </td>
                <td valign="bottom">
                    <asp:TextBox ID="TeamIdTextBox" runat="server" MaxLength="12" ValidationGroup="IdSearch"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="Button4" runat="server" ValidationGroup="IdSearch" Text="Search"
                        OnClick="TeamId_Click" CssClass="GreenButtonTextStyle" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator5" ControlToValidate="TeamIdTextBox"
                        ErrorMessage="Illigal Team Id" ValidationExpression="^[0-9]{1,12}$" ValidationGroup="IdSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchTeamByNameGridView" runat="server" DataSourceID="SearchTeamByNameSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Teams"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "TeamHomePage.aspx?TeamId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No teams match search team by Name
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchTeamByNameSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchTeamByName" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:GridView ID="SearchTeamByIdGridView" runat="server" DataSourceID="SearchTeamByIdSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="teams"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "TeamHomePage.aspx?TeamId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No teams match search team by Id
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchTeamByIdSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchTeamById" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlCoach" runat="server" Height="382px" Width="278px">
        <table style="width: 100%;">
            <tr>
                <td>
                    <asp:Label ID="CoachFirstNameTitleLabel" runat="server" Text="First Name:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="TextBox1" runat="server" MaxLength="128" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="CoachLastNameTitleLabel" runat="server" Text="Last Name:" SkinID="InfoLabel"></asp:Label>
                    <asp:TextBox ID="TextBox2" runat="server" MaxLength="128" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button6" runat="server" ValidationGroup="NameSearch" Text="Search"
                        OnClick="CoachName_Click" CssClass="GreenButtonTextStyle" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator7" ControlToValidate="FirstNameTextBox"
                        ErrorMessage="Illigal first name" ValidationExpression="^[0-9a-zA-Z]{2,128}$"
                        ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator8" ControlToValidate="LastNameTextBox"
                        ErrorMessage="Illigal last name" ValidationExpression="^[0-9a-zA-Z]{2,128}$" ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="CoachIdTitleLabel" runat="server" Text="CoachId:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="CoachIdTextBox" runat="server" MaxLength="12" ValidationGroup="IdSearch"></asp:TextBox>
                </td>
                <td valign="bottom">
                    <asp:Button ID="Button7" runat="server" ValidationGroup="IdSearch" Text="Search"
                        OnClick="CoachId_Click" CssClass="GreenButtonTextStyle"  />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator9" ControlToValidate="CoachIdTextBox"
                        ErrorMessage="Illigal Coach Id" ValidationExpression="^[0-9]{1,12}$" ValidationGroup="IdSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchCoachByNameGridView" runat="server" DataSourceID="SearchCoachByNameSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="coaches"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "Coach.aspx?Id={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No coaches match search Coach by Name
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchCoachByNameSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchCoachByName" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:GridView ID="SearchCoachByIdGridView" runat="server" DataSourceID="SearchCoachByIdSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="coaches"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("Id", "Coach.aspx?Id={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No coaches match search coach by Id
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchCoachByIdSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchCoachById" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlUser" runat="server" Height="382px" Width="278px">
        <table style="width: 100%;">
            <tr>
                <td style="width: 240px" valign="middle">
                    <asp:Label ID="UserNameTitleLabel" runat="server" Text="UserName:" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:TextBox ID="UserNameTextBox" runat="server" MaxLength="256" ValidationGroup="NameSearch"></asp:TextBox>
                </td>
                <td align="left">
                    <asp:Button ID="Button8" runat="server" ValidationGroup="NameSearch" Text="Search"
                        OnClick="UserName_Click" CssClass="GreenButtonTextStyle"/>
                </td>
                <td valign="bottom">
                </td>
            </tr>
            <tr>
                <td style="width: 240px">
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator10"
                        ControlToValidate="UserNameTextBox" ErrorMessage="Illigal username" ValidationExpression="^[0-9a-zA-Z]{2,256}$"
                        ValidationGroup="NameSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchUserByNameGridView" runat="server" DataSourceID="SearchUsaerByNameSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Users"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("UserName") %>' NavigateUrl='<%# Eval("UserId", "UserPage.aspx?Id={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No user match search player by username
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchUsaerByNameSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchUser" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlMatch" runat="server" Height="382px" Width="278px">
        <table style="width: 100%;">
            <tr>
                <td style="width: 240px" valign="middle">
                    <asp:Label ID="MatchIdTitleLabel" runat="server" Text="MatchId:"></asp:Label>
                    <br />
                    <asp:TextBox ID="MatchIdTextBox" runat="server" MaxLength="12" ValidationGroup="MatchSearch"></asp:TextBox>
                </td>
                <td align="left">
                    <asp:Button ID="Button9" runat="server" ValidationGroup="MatchSearch" Text="Search"
                        OnClick="Match_Click" CssClass="GreenButtonTextStyle" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 240px">
                    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator11"
                        ControlToValidate="MatchIdTextBox" ErrorMessage="Illigal Match Id" ValidationExpression="^[0-9]{2,12}$"
                        ValidationGroup="MatchSearch"></asp:RegularExpressionValidator>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView ID="SearchMatchByMatchIdGridView" runat="server" DataSourceID="SearchMatchByMatchIdSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" Visible="false" EnableTheming="True">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Matches"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("Id", "MatchPage.aspx?MatchId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No matches for search by MatchId
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="SearchMatchByMatchIdSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_SearchMatch" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </asp:Panel>--%>
</asp:Content>
